package com.hlz.lib.effectivejava.chapter4;

import java.util.Arrays;
import java.util.HashSet;

/**
 * @author Hongliang Zhu
 * @create 2023-08-27 21:43
 */
public class Main {

    public static void main(String[] args) {
//        InstrumentedHashSet<String> set = new InstrumentedHashSet<>();

        HashSet<String> set = new HashSet<>();

//        InstrumentedHashSetWithComposition<String> set1 = new InstrumentedHashSetWithComposition<>(set);
//        set1.addAll(Arrays.asList("Snap", "Jack", "world"));
//        System.out.println(set1.getCount());


        InstrumentedHashSetWithComposition2<String> set2 = new InstrumentedHashSetWithComposition2<>(set);
        set2.addAll(Arrays.asList("Snap", "Jack", "world"));
        System.out.println(set2.getCount());

    }
}
